﻿/*
// Exepack.NET 
// http://www.codeplex.com/exepack
//
// Event helpers
// Written by Y [21-02-10]
// Copyright (c) 2008-2010 Alexey Yakovlev
*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Exepack
{
	/// <summary>
	/// Helper methods for event handling
	/// </summary>
	public static class EventHelpers
	{
		/// <summary>
		/// Triggers event if some event handler exists
		/// </summary>
		public static void Trigger<T>(this EventHandler<T> handler, object sender, T args) where T : EventArgs
		{
			if (handler != null)
			{
				handler(sender, args);
			}
		}
	}
}
